package api

import (
	"github.com/gin-gonic/gin"
	"month3/api/handlers"
	"month3/pkg"
)

func LoadApiRouters(r *gin.Engine) {
	r.POST("/sendSms", handlers.SendSms) //发送短信验证码
	r.POST("/login", handlers.Login)     //登录

	r.Use(pkg.JWTAuth("zj"))

	r.GET("/chat", handlers.Chat)              //聊天
	r.POST("/addArticle", handlers.AddArticle) //发布动态
	r.GET("/list", handlers.List)              //动态列表
	r.POST("/focus", handlers.Focus)           //关注
	r.GET("/list1", handlers.List1)
	r.POST("/updateArticleLike", handlers.UpdateArticleLike) //动态点赞
	r.POST("/addComment", handlers.AddComment)               //添加评论
	r.POST("/addCommentLike", handlers.AddCommentLike)       //评论点赞
	r.POST("/upload", handlers.Upload)                       //文件上传
	r.GET("/history", handlers.History)                      //回溯历史
	r.POST("/addRoom", handlers.AddRoom)                     //创建群聊
	r.POST("/addRoomUser", handlers.AddRoomUser)             //拉人
	r.POST("/updateRoomUser", handlers.UpdateRoomUser)       //分配权限
	r.POST("/delRoomUser", handlers.DelRoomUser)             //移除群成员
	r.POST("/delRoom", handlers.DelRoom)                     //解散群聊
}
